package com.tyut.service.impl;

import com.tyut.mapper.TravelMapper;
import com.tyut.pojo.Travel;
import com.tyut.service.TravelService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * 旅游景点业务层接口
 */
@Service
@Transactional
public class TravelServiceImpl implements TravelService {
    @Resource
    private TravelMapper travelMapper;

    public boolean addTravel(Travel travel) {
        return travelMapper.addTravel(travel) > 0;
    }

    public boolean deleteTravel(Integer id) {
        return travelMapper.deleteTravel(id) > 0;
    }

    public void updateTravel(Travel travel) {
        travelMapper.updateTravel(travel);
    }
    public List<Travel> queryListTravel() {
            return travelMapper.queryListTravel();
    }

    public Travel queryTravelById(Integer id) {
        return travelMapper.queryTravelById(id);
    }

    public List<Travel> queryListTravelByLabel(Integer label) {
        return travelMapper.queryListTravelByLabel(label);
    }
}
